﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace 设计模式.前端控制器模式
{
    public class Dispatcher
    {
        private StudentView studentView;
        private HomeView homeView;

        public Dispatcher()
        {
            studentView = new();
            homeView = new();
        }

        public void Dispatch(string request)
        {
            if (request.Equals("student", StringComparison.OrdinalIgnoreCase))
            {
                studentView.Show();
            }
            else
            {
                homeView.Show();
            }
        }
    }
}
